<aside class="left-side sidebar-offcanvas">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">
            <li>
                <a href="<?php echo asset('/'); ?>">
                    <i class="fa fa-home"></i> <span>Trang chủ</span>
                </a>
            </li>
            <?php
            $chuc_nang = new Chuc_nang();
            $ds_chuc_nang = $chuc_nang->chung_nang_tai_khoan(Auth::user()->id);
            foreach ($ds_chuc_nang as $ds_chuc_nang) {

                if($ds_chuc_nang->route == 'danh-muc'){
                    ?>
                        <li class="treeview">
                            <a href="#" >
                                <i class="fa fa-bars icon-sidebar"></i>
                                Danh mục
                                <i class="fa pull-right fa-angle-left"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo asset('functions')?>"><i class="fa fa-angle-double-right"></i>Danh mục chức năng</a></li>
                                <li ><a href="<?php echo asset('certificates')?>"><i class="fa fa-angle-double-right"></i>Danh mục chứng chỉ</a></li>
                                <li ><a href="<?php echo asset('boards')?>"><i class="fa fa-angle-double-right"></i>Danh mục hội đồng thi</a></li>
                                <li ><a href="<?php echo asset('courses')?>"><i class="fa fa-angle-double-right"></i>Danh mục khóa thi</a></li>
                                <li ><a href="<?php echo asset('categories')?>"><i class="fa fa-angle-double-right"></i>Chuyên mục bài viết</a></li>
                            </ul>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'ket-qua'){
                    ?>
                        <li class="treeview">
                            <a href="#" >
                                <i class="fa fa-reply-all icon-sidebar"></i>
                                Kết quả
                                <i class="fa pull-right fa-angle-left"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo asset('students')?>"><i class="fa fa-angle-double-right"></i>Thi chứng chỉ</a></li>
                                <li ><a href="<?php echo asset('resultcerts')?>"><i class="fa fa-angle-double-right"></i>Cấp bằng</a></li>
                            </ul>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'khai-giang'){
                    ?>
                        <li class="treeview">
                            <a href="#" >
                                <i class="fa  fa-star icon-sidebar"></i>
                                Khai giảng
                                <i class="fa pull-right fa-angle-left"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo asset('manager-courses')?>"><i class="fa fa-angle-double-right"></i>Khóa học</a></li>
                                <li ><a href="<?php echo asset('schedules')?>"><i class="fa fa-angle-double-right"></i>Khóa thi</a></li>
                            </ul>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'news'){
                    ?>
                        <li class="">
                            <a href="<?php echo asset('news')?>" >
                                <i class="fa fa-edit icon-sidebar"></i>
                                Bài viết
                            </a>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'contacts/editcontact'){
                    ?>
                        <li class="">
                            <a href="<?php echo asset('contacts/editcontact')?>" >
                                <i class="fa fa-phone icon-sidebar"></i>
                                Liên hệ
                            </a>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'accounts'){
                    ?>
                        <li class="">
                            <a href="<?php echo asset('accounts')?>" >
                                <i class="fa fa-users icon-sidebar"></i>
                                Quản lý tài khoản
                            </a>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'statistics'){
                    ?>
                        <li class="">
                            <a href="<?php echo asset('statistics')?>" >
                                <i class="fa fa-bar-chart-o icon-sidebar"></i>
                                Thống kê
                            </a>
                        </li>   
                <?php
                }if($ds_chuc_nang->route == 'hoc-vien'){
                    ?>
                        <li class="treeview">
                            <a href="#" >
                                <i class="fa fa-user icon-sidebar"></i>
                                Học viên
                                <i class="fa pull-right fa-angle-left"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="<?php echo asset('manager-students/courses')?>"><i class="fa fa-angle-double-right"></i>Học viên khóa học</a></li>
                                <li ><a href="<?php echo asset('manager-students/schedules')?>"><i class="fa fa-angle-double-right"></i>Học viên khóa thi</a></li>
                            </ul>
                        </li>   
                <?php
                }
            }
            ?>  
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>

